<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    ul,
    li {
      list-style: none;
      margin: 0;
      padding: 0;
      font-size: 14px;
      box-sizing: border-box;
    }

    #nav>li {
      width: 120px;
      float: left;
      height: 30px;
      line-height: 30px;
      background-color: #171a24;
      border: solid 1px #fff;
    }

    #nav a {
      display: block;
      text-decoration: none;
      color: #fff;
      margin-left: 4px;
    }

    #nav ul li {
      background-color: #5f6377;
      color: #fff;
      border-bottom: solid 1px #fff;
    }

    #nav ul {
      display: none;
    }
  </style>
</head>

<body>
  <ul id="nav">
    <li>
      <a href="javascript:;">菜单一</a>
      <ul>
        <li>子菜单1-1</li>
        <li>子菜单1-2</li>
        <li>子菜单1-3</li>
      </ul>
    </li>
    <li>
      <a href="javascript:;">菜单二</a>
      <ul>
        <li>子菜单2-1</li>
        <li>子菜单2-2</li>
        <li>子菜单2-3</li>
      </ul>
    </li>
    <li>
      <a href="javascript:;">菜单三</a>
      <ul>
        <li>子菜单3-1</li>
        <li>子菜单3-2</li>
        <li>子菜单3-3</li>
      </ul>
    </li>
  </ul>


</body>

</html>